import os
from openai import OpenAI

client = OpenAI(
    # This is the default and can be omitted
    api_key="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"
)

chat_completion = client.chat.completions.create(
    messages=[
        {
            "role": "user",
            "content": "今天的日期是多少",
        }
    ],
    model="gpt-3.5-turbo",
)

print(chat_completion)

# ChatCompletion(id='chatcmpl-8yzeHYmrx4gRFmgjWCWRumCDL1fca', choices=[Choice(finish_reason='stop', index=0, logprobs=None, message=ChatCompletionMessage(content='我是一名人工智能助手，可以为您提供信息和回答问题。有什么可以帮到您的吗？', role='assistant', function_call=None, tool_calls=None))], created=1709547349, model='gpt-3.5-turbo-0125', object='chat.completion', system_fingerprint='fp_2b778c6b35', usage=CompletionUsage(completion_tokens=38, prompt_tokens=11, total_tokens=49))
